﻿@typeparam TItem
@inherits _BaseDataGridNewCommand<TItem>
@if ( ParentDataGrid.CommandColumn?.NewCommandAllowed == true )
{
    var newButtonString = Localizer.Localize( ParentDataGrid.Localizers?.NewButtonLocalizer, "New" );

    @if ( ParentDataGrid.CommandColumn?.NewCommandTemplate != null )
    {
        @ParentDataGrid.CommandColumn.NewCommandTemplate( new()
        {
            Clicked = New,
            LocalizationString = newButtonString,
        } )
    }
    else
    {
        <Button Color="Color.Link" Clicked="@New">
            @newButtonString
        </Button>
    }
}